package studio.wetrack.mongo.interfacelog;

import org.bson.Document;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @author linzh
 * @date 2018-09-29 10:52
 */
public class InterfaceLog {
    private Long timestamp;
    private String userId;
    private List<Object> args;
    private Integer status;

    public Long getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(Long timestamp) {
        this.timestamp = timestamp;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public List<Object> getArgs() {
        return args;
    }

    public void setArgs(List<Object> args) {
        this.args = args;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }


    public Document createDocument() {
        Document document = new Document();
        document.append("timestamp", timestamp);
        if (args != null) {
            document.append("args",args);
        }
        document.append("status",status);
        document.append("userId",userId);
        return document;
    }
}
